home *** CD-ROM | disk | FTP | other *** search
/ Alles Voor Internet / Tout Pour Internet / alles voor internet.iso / MacInternet™ / Net / Utilities / Seer family 2.0 / seer_common / sc_event.c < prev    next >
Encoding:
C/C++ Source or Header  |  1987-08-29  |  1.3 KB  |  53 lines  |  [TEXT/KAHL]

  1. /*
  2.     sc_event.c - events common to scope windows and packet
  3. */
  4. #include "sc.h"
  5. #include "sc_event.h"
  6.  
  7. void e_grow(where)
  8. Point where;
  9. {(*gl.cur_windef->w_grow)(where);
  10. }
  11.  
  12. void e_activate(a_win)
  13. WindowPtr a_win;
  14. {if(((WindowPeek)a_win)->windowKind!=gl.win_ref_num)
  15.      bomb(BOMB_badwind,BMB_no_os,(long)gl.cur_windef->wd_type);
  16.  gl.cur_windef=(windef *)(a_win);
  17.  SetPort(CUR_WINDOW);
  18.  (*gl.cur_windef->w_activate)();
  19. }
  20.  
  21. void e_deactivate(a_win)
  22. WindowPtr a_win;
  23. {(*gl.cur_windef->w_deactavate)();
  24.  SetPort(NIL);
  25.  gl.cur_windef=NIL;
  26. }
  27.  
  28. /*handle mouse down in the content region*/
  29. void e_down_content(the_event)
  30. EventRecord *the_event;
  31. {(*gl.cur_windef->w_mouse_down)(the_event);
  32. }
  33.  
  34. /*process an update event*/
  35. void e_update_event(the_event)
  36. EventRecord *the_event;
  37. {windef *save_windef;                /*pointer to our per window information*/
  38.  WindowPtr save_window;
  39.  GetPort(&save_window);
  40.  save_windef=gl.cur_windef;            /*change the windef with the port*/
  41.  gl.cur_windef= (windef *)(the_event->message);
  42.  SetPort(CUR_WINDOW);               /*switch to the port to update*/
  43.  
  44.  BeginUpdate(CUR_WINDOW);
  45.  EraseRect(&CUR_WINDOW->portRect); /*yes, clear the update area*/
  46.  UpdtControl(CUR_WINDOW,CUR_WINDOW->visRgn);/*draw its controls*/
  47.  (*gl.cur_windef->w_draw)();
  48.  EndUpdate(CUR_WINDOW);
  49.  SetPort(save_window);
  50.  gl.cur_windef=save_windef;
  51. }
  52.  
  53.